/**
 * Please modify this class to meet your needs
 * This class is not complete
 */

package com.cctv.esb._interface.taskreceiveservice._0_1;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List;
import java.util.logging.Logger;
import javax.xml.bind.JAXBElement;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.XMLGregorianCalendar;

import org.apache.commons.collections.keyvalue.TiedMapEntry;
import org.apache.commons.lang3.StringUtils;
import com.cctv.cdm.schema.bclistandchangeinfotype._0.BroadcastListAndChangeInfoType;
import com.cctv.cdm.schema.directsendnotificationtype._1.DirectSendNotificationType;
import com.cctv.cdm.schema.ldirectsendnotificationtype._1.LDirectSendNotificationType;
import com.cctv.cdm.schema.liveprogramnotificationtype._1.LiveProgramNotificationType;
import com.cctv.cdm.schema.lliveprogramnotificationnewtype._1.LLiveProgramNotificationNewType;
import com.cctv.cdm.schema.lliveprogramnotificationnewtype._1.LLiveProgramNotificationNewType.LivePlayPlans.LivePlayPlan;
import com.cctv.esb.schema.commoncomplextype._0.ProgramBasicInfoType;
import com.cctv.esb.schema.commoncomplextype._0.UserInfoType;
import com.cctv.esb.schema.taskdatatypes._0.TaskBasicInfoType;
import com.cctv.esb.schema.taskdatatypes._0.TaskSpecificInfoType;
import com.cctv.esb.schema.taskmessages._0.CommonTaskResponseType;
import com.cctv.esb.schema.taskmessages._0.ReceiveTaskRequestType;
import com.cctv.ppm.schema.ppm_commondatatypes._0.BroadcastListInfoType;
import com.cctv.ppm.schema.ppm_commondatatypes._0.BroadcastListItemType;
import com.cctv.ppm.schema.ppm_commondatatypes._0.ProgAvailableStatusType;
import com.cctv.ppm.schema.progplaystatus._0.ProgPlayStatusType;
import com.ctvit.framework.web.context.ContextHolder;
import com.ctvit.wsservice.basedata.domain.*;
import com.ctvit.wsservice.basedata.service.TaskReceiveService;

/**
 * This class was generated by Apache CXF 3.1.4 2015-12-16T15:49:01.831+08:00
 * Generated source version: 3.1.4
 * 
 */

@javax.jws.WebService(serviceName = "ReceiveTaskHttpService", portName = "ReceiveTaskPort", targetNamespace = "http://cctv.com/MSG/service/TaskReceiveService/0.1", endpointInterface = "com.cctv.esb._interface.taskreceiveservice._0_1.TaskReceive")
public class ReceiveTaskPortImpl implements TaskReceive {

	private static final Logger LOG = Logger.getLogger(ReceiveTaskPortImpl.class.getName());

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.cctv.esb._interface.taskreceiveservice._0_1.TaskReceive#receiveTask
	 * (com.cctv.esb.schema.messagehead._0.RequestHeadType requestHead
	 * ,)com.cctv.esb.schema.taskmessages._0.ReceiveTaskRequestType
	 * receiveTaskRequest )*
	 */
	public com.cctv.esb.schema.taskmessages._0.CommonTaskResponseType receiveTask(com.cctv.esb.schema.messagehead._0.RequestHeadType requestHead,
			com.cctv.esb.schema.taskmessages._0.ReceiveTaskRequestType receiveTaskRequest) {
		LOG.info("Executing operation receiveTask");
		System.out.println(requestHead);
		System.out.println(receiveTaskRequest);
		TaskReceiveService taskReceiveService = ContextHolder.getBean(TaskReceiveService.class);
		com.cctv.esb.schema.taskmessages._0.CommonTaskResponseType _return = new CommonTaskResponseType();
		ZcdmTLive zcdmTLive = null; // 直播单主表
		ZcdmTProrec zcdmTProrec = null; // 节目播出单主表
		ZcdmTProglist zcdmTProglist = null;// 节目播出单子表
		ZcdmTLiveCoor zcdmTLiveCoor = null; // 直播单子表
		ZcdmTDiresend zcdmTDiresend = null;// 直送通知单
		ZcdmTDireCoor zcdmTDireCoor = null;// 直送通知单子表
		ZcdmTLongSend zcdmTLongSend = null;// 长效直送通知单
		ZcdmTLongCoor zcdmTLongCoor = null;// 长效直送人员
		ZcdmTLonglive zcdmTLonglive = null;// 长效直播协调单主表
		ZcdmTLonglist zcdmTLonglist = null;// 长效直播协调单子表
		ZcdmTProgplaystatus zcdmTProgplaystatus = null; // 节目可播出状态
		List<ZcdmTProglist> list = new ArrayList<ZcdmTProglist>(); // 节目单子表对象的容器
		String taskid=receiveTaskRequest.getTaskItem().get(0).getTaskID();
		try {
			TaskBasicInfoType taskBasicInfoType = getTaskBasicInfoType(receiveTaskRequest);
			if (StringUtils.equals(taskBasicInfoType.getTaskType(), "CI") && StringUtils.equals(requestHead.getTargetSysID(), "ES01")) {// 接收每个节目代码给媒资的入库任务prd09
				ProgramBasicInfoType programBasicInfoType = receiveTaskRequest.getTaskItem().get(0).getProgramBasicInfo();
				ZppmTask zppmTask = new ZppmTask();
				ZppmTProginfo zppmTProginfo = new ZppmTProginfo();
				zppmTask.setZTaskName(requestHead.getTargetService());
				zppmTask.setZTaskId(receiveTaskRequest.getTaskItem().get(0).getTaskID());
				zppmTask.setZAssignTime(taskBasicInfoType.getAssignTime());
				zppmTask.setZProcode(programBasicInfoType.getProgramCode());
				zppmTask.setZCapVer(programBasicInfoType.getSubtitleLanguage().getLangCode());
				zppmTask.setZAudVer(programBasicInfoType.getAudioLanguage().getLangCode());
				zppmTask.setZCreateTime(new Timestamp(Calendar.getInstance().getTimeInMillis()));
				zppmTProginfo.setZProcode(programBasicInfoType.getProgramCode());
				zppmTProginfo.setZCapVer(programBasicInfoType.getSubtitleLanguage().getLangCode());
				zppmTProginfo.setZAudVer(programBasicInfoType.getAudioLanguage().getLangCode());
				zppmTProginfo.setZPgnam(programBasicInfoType.getProgramName());
				zppmTProginfo.setZSubjCd(programBasicInfoType.getOwnershipColumns());
				zppmTProginfo.setZTimeEstm(programBasicInfoType.getProgDuration().replaceAll(":", ""));

				int ret = taskReceiveService.saveProgInfo(zppmTask, zppmTProginfo);
				_return = setPrd07ResponseMessage(ret);
			}
			TaskSpecificInfoType taskSpecificInfoType = getType(receiveTaskRequest);// 获取到节目单的类型
			if (StringUtils.equals(taskSpecificInfoType.getObjectType(), "BroadcastListInfo")) {
				zcdmTProrec = new ZcdmTProrec(); // 节目播出单主表
				BroadcastListAndChangeInfoType bChangeInfoType = taskSpecificInfoType.getObjectEntity().getBroadcastListAndChangeInfoRequest();
				JAXBElement<BroadcastListInfoType> broadcast = bChangeInfoType.getBroadcastListInfo();
				BroadcastListInfoType broadcastListInfoType = broadcast.getValue();
				zcdmTProrec.setZProRecCd(broadcastListInfoType.getBroadcastListID());// 节目播出单标识
				zcdmTProrec.setZPlayDate(broadcastListInfoType.getPlayDate().toGregorianCalendar().getTime()); // 播出日期
				zcdmTProrec.setZChanlCd(broadcastListInfoType.getChannelCode());// 频道代码
				zcdmTProrec.setZDraftTp(broadcastListInfoType.getPlayListType().value()); // 节目单类型
				zcdmTProrec.setZVersionNo(broadcastListInfoType.getPlaylistVersion().longValue());// 节目单版本号
				zcdmTProrec.setZLockstatus(broadcastListInfoType.getPlaylistLockStatus()); // 发布锁定
				zcdmTProrec.setZCrtim(new Timestamp(Calendar.getInstance().getTimeInMillis()));//创建时间
				/******************* 以下是节目单子表的内容 *******************/
				List<BroadcastListItemType> listItemTypes = broadcastListInfoType.getBroadcastListItems().getBroadcastListItem();
				for (int i = 0; i < listItemTypes.size(); i++) {
					zcdmTProglist = new ZcdmTProglist(); // 节目播出单子表
					BroadcastListItemType broadcastListItemType = listItemTypes.get(i);
					zcdmTProglist.setZProItemCd(broadcastListItemType.getBroadcastListItemID()); // 播出单条目标识
					zcdmTProglist.setZSubjPlanId(broadcastListItemType.getColumnPlayPlanID());// 栏目播出计划标识
					zcdmTProglist.setZPlanMatch(broadcastListItemType.getPlanMatchFlag()); // 计划匹配标识
					zcdmTProglist.setZPlayForm(broadcastListItemType.getIsLive());// 播出方式
					zcdmTProglist.setZOrder(broadcastListItemType.getItemIndex().longValue()); // 条目序号
					zcdmTProglist.setZPlayDate(broadcastListInfoType.getPlayDate().toGregorianCalendar().getTime()); // 播出日期
					zcdmTProglist.setZPlayTime(broadcastListItemType.getPlayTime().replace(":", ""));// 播出时间
					zcdmTProglist.setZSubjTime(broadcastListItemType.getDuration().replace(":", ""));// 栏目时长
					zcdmTProglist.setZProRtmlen(broadcastListItemType.getProgDuration().replace(":", "")); // 节目实际长度
					zcdmTProglist.setZAdTime(broadcastListItemType.getADDuration());//中插广告时长
					zcdmTProglist.setZPlaySubjCd(broadcastListItemType.getColumnCode()); // 播出栏目代码
					zcdmTProglist.setZProcode(broadcastListItemType.getProgramCode()); // 节目代码
					zcdmTProglist.setZPgnam(broadcastListItemType.getProgramName());// 节目名称
					zcdmTProglist.setZCapVer(broadcastListItemType.getSubtitleLanguage().getLangCode());// 字幕语言版本
					zcdmTProglist.setZAudVer(broadcastListItemType.getAudioLanguage().getLangCode());// 音频语言版本
					zcdmTProglist.setZHdFlag(broadcastListItemType.getVideo());// 高清标志
					zcdmTProglist.setZAfd(broadcastListItemType.getAFD());// AFD信息
					zcdmTProglist.setZAudioType(broadcastListItemType.getAudio());// 声道信息
					zcdmTProglist.setZCarrierType(broadcastListItemType.getMediaType());// 成品节目交付介质类型
					// TODO: 用X代替true / ""代替false
					if (broadcastListItemType.isNewsFlag()) {
						zcdmTProglist.setZIsNewsFlag("X");
					} else
						zcdmTProglist.setZIsNewsFlag("");
					zcdmTProglist.setZIsAd(broadcastListItemType.getIsAD());// 是否广告
					// breakPointID
					zcdmTProglist.setZBreakpointId(broadcastListItemType.getBreakPointID());
					// fuzhi
					zcdmTProglist.setZInsertWay(broadcastListItemType.getIP());
					// fuzhi
					zcdmTProglist.setZAdTime(broadcastListItemType.getADDuration().replace(":", ""));
					// TODO: 用X代替true / ""代替false
					if (broadcastListItemType.isIsChannelBranding())
						zcdmTProglist.setZChanlCasing("X");
					else
						zcdmTProglist.setZChanlCasing("");
					zcdmTProglist.setZBreakFlg(broadcastListItemType.getBreakFlag());
					zcdmTProglist.setZInForm(broadcastListItemType.getThroughType()); // 入库形式
					zcdmTProglist.setZProItemSta(broadcastListItemType.getPlayItemReadyStatus());// 播出条目状态
					zcdmTProglist.setZProgSegsum(Long.parseLong(broadcastListItemType.getProgSegmentSum()));// 节目分段总数
					zcdmTProglist.setZLimitAd(broadcastListItemType.getLimitADSegmentSum().longValue());// 广告中插总次数
					zcdmTProglist.setZChanlCd(broadcastListInfoType.getChannelCode());// 频道代码
					zcdmTProglist.setZCrtim(new Timestamp(GregorianCalendar.getInstance().getTimeInMillis()));//创建时间
					list.add(zcdmTProglist);
				}
				try {
					_return = setResponseMessage(taskReceiveService.save(zcdmTProrec, list),taskid);// 设置返回的消息类型
				} catch (Exception e) {
					// TODO: handle exception
					e.printStackTrace();
				}
				// 节目直播单
			} else if (StringUtils.equals(taskSpecificInfoType.getObjectType(), "LiveProgramNotification")) {
				zcdmTLive = new ZcdmTLive(); // 直播单主表
				LiveProgramNotificationType liveProgramNotificationType = taskSpecificInfoType.getObjectEntity().getLiveProgramNotificationRequest();
				zcdmTLive.setZLiveCd(liveProgramNotificationType.getLiveProgramNotificationID()); // Z_LIVE_CD
				zcdmTLive.setZPgnam(liveProgramNotificationType.getProgramName());// 节目名称
				zcdmTLive.setZProcode(liveProgramNotificationType.getProgramCode());// 节目代码
				zcdmTLive.setZChanlCd(liveProgramNotificationType.getChannelCode()); // 频道代码
				zcdmTLive.setZDeptCd(liveProgramNotificationType.getAssociatedPersons().getAssociatedPerson().get(0).getDepartmentCode());//部门代码
				zcdmTLive.setZLiveDate(liveProgramNotificationType.getLivePlayDate().toGregorianCalendar().getTime());// 播出日期
				zcdmTLive.setZLiveBetim(liveProgramNotificationType.getLivePlayTime().replace(":", "")); // 直播起始时间
				zcdmTLive.setZLiveEntim(liveProgramNotificationType.getIsEndTimeSure().replace(":", ""));// 直播结束时间
				zcdmTLive.setZProRtmlen(liveProgramNotificationType.getDuration().replace(":", ""));// 节目实际时长
				zcdmTLive.setZLivePlace(liveProgramNotificationType.getLiveLocale());// 直播现场
				zcdmTLive.setZPlayroom(liveProgramNotificationType.getStudioID());// 直播演播室编号
				zcdmTLive.setZPlayroomNm(liveProgramNotificationType.getStudioName());// 直播演播室名称
				zcdmTLive.setZAudVer(liveProgramNotificationType.getAudioLanguage().getLangCode());// 音频语言版本
				zcdmTLive.setZCapVer(liveProgramNotificationType.getSubtitleLanguage().getLangCode());// 字幕语言版本
				zcdmTLive.setZLiveDelay(liveProgramNotificationType.getDelayTime().toString());// 时延时间
				zcdmTLive.setZComment(liveProgramNotificationType.getLiveComment());// 描述
				/********************** 直播单人员表 **********************/
				List<UserInfoType> userList = liveProgramNotificationType.getAssociatedPersons().getAssociatedPerson();
				List<ZcdmTLiveCoor> listZcdmCoor = new ArrayList<ZcdmTLiveCoor>();
				for (int i = 0; i < userList.size(); i++) {
					zcdmTLiveCoor = new ZcdmTLiveCoor(); // 直播单子表
					UserInfoType userInfoType = userList.get(i);
					zcdmTLiveCoor.setZLiveCd(liveProgramNotificationType.getLiveProgramNotificationID());
					zcdmTLiveCoor.setZUserId(userInfoType.getUserID());// 用户id
					zcdmTLiveCoor.setZUserNm(userInfoType.getUserName());// 用户名称
					zcdmTLiveCoor.setZOfficeNum(userInfoType.getTelPhone());//办公电话
					zcdmTLiveCoor.setZMobileNum(userInfoType.getOfficeLoc());//移动电话
					listZcdmCoor.add(zcdmTLiveCoor);
				}
				try {
					_return = setResponseMessage(taskReceiveService.save(zcdmTLive, listZcdmCoor),taskid);// 设置返回的消息类型
				} catch (Exception e) {
					// TODO: handle exception
					e.printStackTrace();
				}
			} else if (StringUtils.equals(taskSpecificInfoType.getObjectType(), "DirectSendNotification")) {
				zcdmTDiresend = new ZcdmTDiresend();// 直送通知单
				DirectSendNotificationType directSendNotificationType = taskSpecificInfoType.getObjectEntity().getDirectSendNotificationRequest();
				zcdmTDiresend.setZDiresendCd(directSendNotificationType.getDirectSendInfoID());// 直送通知单标识
				zcdmTDiresend.setZChanlCd(directSendNotificationType.getChannelCode());// 频道代码
				zcdmTDiresend.setZSubjCd(directSendNotificationType.getColumnCode());// 栏目代码
				zcdmTDiresend.setZPlayDate(directSendNotificationType.getPlayDate().toGregorianCalendar().getTime());// 播出日期
				zcdmTDiresend.setZPlayTime(directSendNotificationType.getPlayTime().replace(":", ""));// 播出时间
				zcdmTDiresend.setZProcode(directSendNotificationType.getProgramCode());// 节目代码
				zcdmTDiresend.setZPgnam(directSendNotificationType.getProgramName());// 节目名称
				zcdmTDiresend.setZAudVer(directSendNotificationType.getAudioLanguage().getLangCode());// 音频语言版本
				zcdmTDiresend.setZCapVer(directSendNotificationType.getSubtitleLanguage().getLangCode());// 字幕语言版本
				zcdmTDiresend.setZProgSegsum(Long.parseLong(directSendNotificationType.getProgSegmentSum()));// 节目分段总数
				zcdmTDiresend.setZDiresendType(directSendNotificationType.getDirectSendType());// 直送介质类型
				zcdmTDiresend.setZDiresendReas(directSendNotificationType.getDirectSendReason());// 直送原因
				zcdmTDiresend.setZComment(directSendNotificationType.getComment());// 备注
				zcdmTDiresend.setZCrtim(new Date());
				/********************** 直送单人员表 **********************/
				List<UserInfoType> userList = directSendNotificationType.getCoordinatorInfo().getAssociatedPerson();
				List<ZcdmTDireCoor> listDireCoors = new ArrayList<ZcdmTDireCoor>();
				for (int i = 0; i < userList.size(); i++) {
					zcdmTDireCoor = new ZcdmTDireCoor();
					UserInfoType userInfoType = userList.get(i);
					zcdmTDireCoor.setZDiresendCd(directSendNotificationType.getDirectSendInfoID());// 直送通知单标识
					zcdmTDireCoor.setZUserId(userInfoType.getUserID());// 用户id
					zcdmTDireCoor.setZUserNm(userInfoType.getUserName());// 用户name
					zcdmTDireCoor.setZOfficeNum(userInfoType.getTelPhone());//办公电话
					zcdmTDireCoor.setZMobileNum(userInfoType.getMobilePhone());//移动电话
					listDireCoors.add(zcdmTDireCoor);
				}
				try {
					_return = setResponseMessage(taskReceiveService.save(zcdmTDiresend, listDireCoors),taskid);
				} catch (Exception e) {
					e.printStackTrace();
				}
			} else if (StringUtils.equals(taskSpecificInfoType.getObjectType(), "LDirectSendNotification")) {
				zcdmTLongSend = new ZcdmTLongSend();
				LDirectSendNotificationType lDirectSendNotificationType = taskSpecificInfoType.getObjectEntity().getLDirectSendNotificationRequest();
				zcdmTLongSend.setZDiresendCd(lDirectSendNotificationType.getLongTermDirectID());// 直送通知单标识
				zcdmTLongSend.setZChanlCd(lDirectSendNotificationType.getChannelCode());// 频道代码
				zcdmTLongSend.setZBeginDate(lDirectSendNotificationType.getPlayBeginDate().toGregorianCalendar().getTime());// 开始日期
				zcdmTLongSend.setZEndDate(lDirectSendNotificationType.getPlayEndDate().toGregorianCalendar().getTime());// 结束日期
				zcdmTLongSend.setZSubjCd(lDirectSendNotificationType.getColumnCode());//栏目代码
				zcdmTLongSend.setZPlayTime(lDirectSendNotificationType.getPlayTimeDesc().replace(":", ""));// 播出时间
				zcdmTLongSend.setZDiresendType(lDirectSendNotificationType.getDirectSendType());// 直送介质类型
				zcdmTLongSend.setZDiresendReas(lDirectSendNotificationType.getDirectSendReason());// 直送原因
				zcdmTLongSend.setZComment(lDirectSendNotificationType.getComment());// 备注
				zcdmTLongSend.setZCrtim(new Date());//创建时间
				List<UserInfoType> userList = lDirectSendNotificationType.getCoordinatorInfo().getAssociatedPerson();
				List<ZcdmTLongCoor> listLongCoor = new ArrayList<ZcdmTLongCoor>();
				/********************** 长效直送单人员表 **********************/
				for (int i = 0; i < userList.size(); i++) {
					zcdmTLongCoor = new ZcdmTLongCoor();
					UserInfoType userInfoType = userList.get(i);
					zcdmTLongCoor.setZDiresendCd(lDirectSendNotificationType.getLongTermDirectID());
					zcdmTLongCoor.setZUserId(userInfoType.getUserID());// 用户id
					zcdmTLongCoor.setZUserNm(userInfoType.getUserName());// 用户名称
					zcdmTLongCoor.setZOfficeNum(userInfoType.getTelPhone());//办公电话
					zcdmTLongCoor.setZMobileNum(userInfoType.getOfficeLoc());//移动电话
					zcdmTLongCoor.setZComment(lDirectSendNotificationType.getComment());// 备注
					listLongCoor.add(zcdmTLongCoor);
				}
				try {
					_return = setResponseMessage(taskReceiveService.save(zcdmTLongSend, listLongCoor),taskid);
				} catch (Exception e) {
					e.printStackTrace();
				}
				// 长效直播协调单发布
			} else if (StringUtils.equals(taskSpecificInfoType.getObjectType(), "LLiveProgramNotificationNew")) {
				zcdmTLonglive = new ZcdmTLonglive();
				LLiveProgramNotificationNewType liveProgramNotificationNewType = taskSpecificInfoType.getObjectEntity()
						.getLLiveProgramNotificationNewRequest();
				zcdmTLonglive.setZLiveLongCd(liveProgramNotificationNewType.getLongTermLiveInfoID());// 长效直播协调单标识
				zcdmTLonglive.setZSubjCd(liveProgramNotificationNewType.getColumnCode());//栏目代码
				zcdmTLonglive.setZBegDate(liveProgramNotificationNewType.getPlayBeginDate().toGregorianCalendar().getTime());// 起始日期
				zcdmTLonglive.setZEndDate(liveProgramNotificationNewType.getPlayEndDate().toGregorianCalendar().getTime());// 结束日期
				zcdmTLonglive.setZStartDesc(liveProgramNotificationNewType.getStartDescription());// 开始场景描述
				zcdmTLonglive.setZEndDesc(liveProgramNotificationNewType.getEndDescription());// 结束场景描述
				zcdmTLonglive.setZComment(liveProgramNotificationNewType.getLiveComment());// 备注
				zcdmTLonglive.setZCrtim(new Date());//创建时间
				List<LivePlayPlan> livePlayPlans = liveProgramNotificationNewType.getLivePlayPlans().getLivePlayPlan();
				List<ZcdmTLonglist> ListLivePlayPlans = new ArrayList<ZcdmTLonglist>();
				for (int i = 0; i < livePlayPlans.size(); i++) {
					zcdmTLonglist = new ZcdmTLonglist();
					LivePlayPlan livePlayPlan = livePlayPlans.get(i);
					zcdmTLonglist.setZLiveLongCd(liveProgramNotificationNewType.getLongTermLiveInfoID());// 长效直播协调单标识
					zcdmTLonglist.setZChanlCd(livePlayPlan.getChannelCode());// 频道代码
					zcdmTLonglist.setZLiveBetim(livePlayPlan.getLivePlayTime().replace(":", ""));// 直播开始时间
					zcdmTLonglist.setZLiveDelay(livePlayPlan.getDelayTime().toString());// 延时时间
					zcdmTLonglist.setZLiveEntim(livePlayPlan.getIsEndTimeSure());// 结束时间
					zcdmTLonglist.setZSubjLength(livePlayPlan.getDuration());// 持续时长
					zcdmTLonglist.setZWeek(livePlayPlan.getWeekday()); // 星期
					zcdmTLonglist.setZLivePlace(livePlayPlan.getLiveLocale());// 直播现场
					ListLivePlayPlans.add(zcdmTLonglist);// 添加对象到容器里
				}
				List<UserInfoType> userInfoTypes = liveProgramNotificationNewType.getCoordinatorInfo().getAssociatedPerson();
				List<ZcdmTLiveCoor> ListLiveCoors = new ArrayList<ZcdmTLiveCoor>();
				for (int i = 0; i < userInfoTypes.size(); i++) {
					zcdmTLiveCoor = new ZcdmTLiveCoor();
					UserInfoType userInfoType = userInfoTypes.get(i);
					zcdmTLiveCoor.setZLiveCd(liveProgramNotificationNewType.getLongTermLiveInfoID());// 长效直播协调单标识
					zcdmTLiveCoor.setZUserId(userInfoType.getUserID());// 用户id
					zcdmTLiveCoor.setZUserNm(userInfoType.getUserName());// 用户名称
					ListLiveCoors.add(zcdmTLiveCoor); // 添加对象到容器里
				}
				try {
					// 设置返回信息
					_return = setResponseMessage(taskReceiveService.save(zcdmTLonglive, ListLivePlayPlans, ListLiveCoors),taskid);
				} catch (Exception e) {
					e.printStackTrace();
				}
			} else if (StringUtils.equals(taskSpecificInfoType.getObjectType(), "ProgPlayStatus")) {
				zcdmTProgplaystatus = new ZcdmTProgplaystatus();
				ProgPlayStatusType playStatusType = taskSpecificInfoType.getObjectEntity().getProgPlayStatus();
				zcdmTProgplaystatus.setZAudVer(playStatusType.getAudioLanguage().getLangCode());//音频
				zcdmTProgplaystatus.setZCapVer(playStatusType.getSubtitleLanguage().getLangCode());//字幕
				zcdmTProgplaystatus.setZPglocFlag(playStatusType.getPorgLocFlag());
				zcdmTProgplaystatus.setZProcode(playStatusType.getProgramCode());//节目代码
				zcdmTProgplaystatus.setZPgnam(playStatusType.getProgramName());//节目名称
				zcdmTProgplaystatus.setZForbidReason(playStatusType.getForbiddenReason());
				ProgAvailableStatusType progAvailableStatusType = playStatusType.getPlayStatus();//播出状态
				zcdmTProgplaystatus.setZPalystatCode(progAvailableStatusType.getProgAvailableStatusCode().toString());
				zcdmTProgplaystatus.setZPalystatName(progAvailableStatusType.getProgAvailableStatusName());
				zcdmTProgplaystatus.setZCretaTime(new Timestamp(GregorianCalendar.getInstance().getTimeInMillis()));//创建时间
				try {
					int rt=taskReceiveService.save(zcdmTProgplaystatus);
					_return = setResponseMessage(rt,taskid);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
			return _return;
		} catch (java.lang.Exception ex) {
			ex.printStackTrace();
			throw new RuntimeException(ex);
		}
	}

	/**
	 * 
	 * @ps: 获取节目单的对象类型 //通过taskSpecificInfoType.getObjectType()获取
	 * @param receiveTaskRequest
	 * @return TaskSpecificInfoType 任务特定信息类型
	 */
	private TaskSpecificInfoType getType(ReceiveTaskRequestType receiveTaskRequest) {
		TaskSpecificInfoType taskSpecificInfoType = receiveTaskRequest.getTaskItem().get(0).getTaskSpecificInfo();
		if (taskSpecificInfoType == null)
			taskSpecificInfoType = new TaskSpecificInfoType();
		return taskSpecificInfoType;
	}

	/**
	 * 
	 * @ps:获取任务基本信息类型
	 * @param receiveTaskRequest
	 * @return
	 */
	private TaskBasicInfoType getTaskBasicInfoType(ReceiveTaskRequestType receiveTaskRequest) {
		TaskBasicInfoType taskBasicInfoType = receiveTaskRequest.getTaskItem().get(0).getTaskBasicInfo();
		if (taskBasicInfoType == null)
			taskBasicInfoType = new TaskBasicInfoType();
		return taskBasicInfoType;
	}
	public XMLGregorianCalendar convertToXMLGregorianCalendar(Date date) {

        GregorianCalendar cal = new GregorianCalendar();
        cal.setTime(date);
        XMLGregorianCalendar gc = null;
        try {
            gc = DatatypeFactory.newInstance().newXMLGregorianCalendar(cal);
        } catch (Exception e) {

             e.printStackTrace();
        }
        return gc;
    }
	/**
	 * 
	 * @ps:
	 * @param  i  执行完数据操作后的返回值
	 * @return message 通用任务指令处理响应类型
	 */
	private CommonTaskResponseType setResponseMessage(int i,String taskid) {
		CommonTaskResponseType _return = new CommonTaskResponseType();
		String message = "";
		String code = "";
		if (i == 0){
			message = "操作已成功!";
		    code = "000";
		}else if (i == -1){
			message = "参数有异常!";
		    code = "050";
		}else if (i == 1){
			message = "信息未更新!";
		    code = "050";
		}
		List<CommonTaskResponseType.TaskResponseInfo> Tasklist = _return.getTaskResponseInfo();
		Tasklist.add(new CommonTaskResponseType.TaskResponseInfo());
		Tasklist.get(0).setTaskID(taskid);
		Tasklist.get(0).setDescription(message);
		Tasklist.get(0).setStatusCode(code);
		_return.setResponseTimeStamp(convertToXMLGregorianCalendar(new Date()));
		return _return;
	}

	private CommonTaskResponseType setPrd07ResponseMessage(int i) {
		CommonTaskResponseType _return = new CommonTaskResponseType();
		String message = "", code = "";
		if (i == 0) {
			code = "000";
			message = "操作已成功!";
		} else if (i == -1) {
			code = "050";
			message = "任务号已存在!";
		}
		List<CommonTaskResponseType.TaskResponseInfo> Tasklist = _return.getTaskResponseInfo();
		Tasklist.add(new CommonTaskResponseType.TaskResponseInfo());
		Tasklist.get(0).setDescription(message);
		Tasklist.get(0).setStatusCode(code);
		return _return;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.cctv.esb._interface.taskreceiveservice._0_1.TaskReceive#getServiceInfo
	 * (com.cctv.esb.schema.monitor._0.GetServiceInfoRequestType
	 * getServiceInfoRequest )*
	 */
	public com.cctv.esb.schema.monitor._0.GetServiceInfoResponseType getServiceInfo(
			com.cctv.esb.schema.monitor._0.GetServiceInfoRequestType getServiceInfoRequest) {
		LOG.info("Executing operation getServiceInfo");
		System.out.println(getServiceInfoRequest);
		try {
			com.cctv.esb.schema.monitor._0.GetServiceInfoResponseType _return = null;
			return _return;
		} catch (java.lang.Exception ex) {
			ex.printStackTrace();
			throw new RuntimeException(ex);
		}
	}
}
